(function () {
    console.log("煤粉颗粒度分布文件");
    let now_open_diag = {}
    now_open_diag.API_URL = ' '
    //创建一个三维场景
    document.getElementById("todayTimer").innerHTML = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
    const devicePixelRatio = window.devicePixelRatio;//设备分辨率
    const initDataFromINnput = () => {
        //重置数据
        // 获取输入框值
        // 获取输入框值  5 6  8 9  11 12  14 15  17 18  20 21   23 24
        let oIndexDiv = document.getElementsByClassName("wendutiao_react")

        for (var i = 0; i < 78; i++) {
            let idZh
            // = 5 + index * 2
            if (i % 13 == 0) {
                idZh = i / 13 + 151
            } else if (i < 13) {
                idZh = i + 12
            } else if (i > 13 && i < 26) {
                idZh = i + 23
            } else if (i > 26 && i < 39) {
                idZh = i + 34
            } else if (i > 39 && i < 52) {
                idZh = i + 45
            } else if (i > 52 && i < 65) {
                idZh = i + 56
            } else if (i > 65) {
                idZh = i + 67
            }
            //
            let iValue = (Number(document.getElementById(idZh).value)).toFixed(0)
            // console.log(document.getElementById(idZh).value, );
            oIndexDiv[i].style.height = iValue + "%"
            oIndexDiv[i].style.background = "green"
        }


    }

    const initEvent = (str) => {//
        //获取事件元素
        let oFootBtns = document.getElementById(str).children //底部菜单 btns
        if (str == "zbf_foot_btns") {
            now_open_diag.username == "admin" ? "" : oFootBtns[oFootBtns.length - 1].style.display = "none"
            // now_open_diag.username == "admin" ? "" : oFootBtns[oFootBtns.length - 2].style.display = "none"
        }
        for (let i = 0; i < oFootBtns.length; i++) {
            oFootBtns[i].onclick = () => {
                for (let ii = 0; ii < oFootBtns.length; ii++) {
                    oFootBtns[ii].className = ""
                }
                oFootBtns[i].className = "active"
                if (str == "zbf_r_btns") {
                    if (i == 8) {
                        for (let o = 6; o < 14; o++) {
                            scene.children[2].children[o].visible = false
                        }
                    } else {
                        scene.children[2].children[13 - i].visible = !scene.children[2].children[13 - i].visible
                    }
                } else {
                    function closeDiag() {
                        timer ? clearInterval(timer) : ""
                        oTodayTimer ? clearInterval(oTodayTimer) : ""

                    }
                    switch (i) {
                        case 0:
                            closeDiag()
                            setTimeout(() => {
                                window.location.href = "/index.html"
                            }, 200)
                            break;
                        case 1:
                            closeDiag()
                            setTimeout(() => {
                                // openFM("全炉膛温度场", 11, "SJDL_IFS_DATA.prj", "全炉膛温度场")
                                window.location.href = "/quanlutang.html"
                            }, 200)

                            break;
                        case 2:
                            closeDiag()
                            setTimeout(() => {
                                // openFM("横截面", 6, "SJDL_IFS_DATA.prj", "横截面")
                                window.location.href = "/hjm.html"
                            }, 200)

                            break;
                        case 3:
                            closeDiag()
                            setTimeout(() => {
                                // openFM("燃烧稳定性监测", 7, "SJDL_IFS_DATA.prj", "燃烧稳定性监测")
                                window.location.href = "/ranshaowendingxing.html"
                            }, 200)

                            break;
                        case 4:
                            closeDiag()
                            setTimeout(() => {
                                // openFM("煤粉分配率", 9, "SJDL_IFS_DATA.prj", "煤粉分配率")
                                window.location.href = "/meifen.html"
                            }, 200)

                            break;
                        case 5:
                            closeDiag()
                            setTimeout(() => {
                                // openFM("煤粉颗粒度分布", 8, "SJDL_IFS_DATA.prj", "煤粉颗粒度分布")
                                window.location.href = "/main/dcimgs/gl/main.html"
                            }, 200)

                            break;
                        case 6:
                            closeDiag()
                            setTimeout(() => {
                                // openFM("预警信息", 12, "SJDL_IFS_DATA.prj", "预警信息")
                                window.location.href = "/yujing.html"
                            }, 200)

                            break;
                        case 7:
                            closeDiag()
                            setTimeout(() => {
                                // openFM("历史数据", 10, "SJDL_IFS_DATA.prj", "历史数据")
                                window.location.href = "/history.html"
                            }, 200)

                            break;
                        case 8:
                            closeDiag()
                            setTimeout(() => {
                                // openFM("历史数据", 10, "SJDL_IFS_DATA.prj", "历史数据")
                                window.location.href = "/dcsHistory.html"
                            }, 200)
                            break;
                        case 9:
                            closeDiag()
                            setTimeout(() => {
                                // openFM("预警阈值配置修改", 14, "SJDL_IFS_DATA.prj", "预警阈值配置修改")
                                window.location.href = "/canshushezhi.html"
                            }, 200)

                            break;
                        default:

                    }

                }
            }
        }
    }

    initEvent('zbf_foot_btns') //底部菜单 btns
    // let c_form = eval('formview_' + now_open_diag.fmname)
    // c_form.onready = function () {// 页面打开 数据加载完成
    //     initDataFromINnput()
    // }
    let timer = setInterval(() => {
        // console.log(1111);

        initDataFromINnput()
    }, 3000)
    let oTodayTimer = setInterval(() => {
        document.getElementById("todayTimer").innerHTML = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
    }, 1000)


})()
